﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>微信墙录入真实姓名以及电话号码</title>

<link rel="stylesheet" href="../addons/meepo_bigwall/template/realname/style.css?t={php echo time();}" type="text/css"/>
<script type="text/javascript" src="../addons/meepo_bigwall/template/realname/jquery-1.8.3.js"> </script> 
  <script type="text/javascript">
  checkMM();
$(document).ready(function(){
   $("#login").click(function(){
	   $(this).css("background-color","#436EEE");
	   $(".error-hint").empty();
     checkval();
   });
});
function checkval(){
    var i=$("#username").val();
    var s=$("#password").val();
    var regPartton=/1[3-8]+\d{9}/;
		if(i==''){
			//$(".error-hint").css("display","block");
			$(".error-hint").html('真实姓名不能为空哦!').css("display","block");
		  return false;
		}
		if(s==''){
		  
		  $(".error-hint").html('电话号码不能为空哦!').css("display","block");
		  return false;
		}
		if(!regPartton.test(s)){
				$(".error-hint").html('电话号码格式不正确哦!').css("display","block");
		          return false;
				
		}
		 //$("#loading").html(
	     //"<img src='../source/modules/guangximingzu/template/mobile/load.gif'/>").css("display","block");
		 $("#loading").css({"display":"block","margin":"0 auto"});
		$.ajax({
		type:"post",
		url:"{php echo $this->createMobileUrl('lurubasic',array('rid'=>$rid))}",
		dataType:'json',
		data:{'username':i,'password':s},
		success:function(json){
            $("#loading").css("display","none");
			
				  if(json.msg=='1'){
					 $(".error-hint").html('网络超时录入失败，请重试!').css("display","block");
					  return false;
				  }else{
					 $(".box").empty();
					 $("#login").hide();
					 
					 $(".box").html("<div class=\"item phone\">恭喜 录入成功!返回，回复任意内容即可上墙</div><div class=\"bord\"></div><div class=\"item phone\" onclick=\"WeixinJSBridge.call('closeWindow');\">返回</div>");
				  }
		    }
		});
}
function checkMM() {
	//var ismm = navigator.userAgent.indexOf("MicroMessenger") > -1;
	//if (ismm == false) {
	//	window.location.href = 'erro.html';
	//}

	var browser = {
		versions : function() {
			var u = navigator.userAgent, app = navigator.appVersion;
			return {
				trident : u.indexOf('Trident') > -1, //IE内核
				presto : u.indexOf('Presto') > -1, //opera内核
				webKit : u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
				gecko : u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
				mobile : !!u.match(/AppleWebKit.*Mobile/)
						|| !!u.match(/Windows Phone/) || !!u.match(/Android/)
						|| !!u.match(/MQQBrowser/),
				ios : !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
				android : u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
				iPhone : u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
				iPad : u.indexOf('iPad') > -1, //是否iPad
				webApp : u.indexOf('Safari') > -1 //是否web应该程序，没有头部与底部
			};
		}()
	}

	if (browser.versions.ios == true || browser.versions.android == true
			|| browser.versions.iPhone == true || browser.versions.iPad == true
			|| browser.versions.mobile == true) {
	}else{
		
		window.location.href = 'error.html';
	}
}

</script>  

</head>
<body>

    <div class="get-bonus">
        <div class="mobile enter-phone-mobile">
            <div class="enter-phone-tip" style="text-align:center">录入真实姓名以及电话号码</div>
            <div class="box">
                <div class="item phone">
                    <input class="enter" type="text" id="username" placeholder="请输入您的真实姓名">
                    <a class="send">必填</a>
                </div>
                <div class="bord"></div>
                <div class="item phone">
                    <input class="enter" type="text" id="password" placeholder="请输入您的联系方式">
					<a class="send">必填</a>
                </div>
				
				
				
            </div>
            <div class="error-hint" style="font-size:15px;text-align:center"></div>
			<div id="loading" style="display:none"></div>
        </div>
        <a class="btn use-bonus-now J_open" style="background-color:#3385ff" id="login">立即录入</a>
    </div><br>
    <div class="enter-phone-tip" style="text-align:center;font-size:20px;background-color:#3385ff;color:#fff;height:40px;line-height:40px">Power By {$ridwall['votepower']}</div>

</body>

</html>
